


function validateForm(obj){
  var hobbies = document.getElementsByName('hobbies[]');

  var flag = false;
  var minCheck = 2;
  var count = 0;
  for (i = 0; i < hobbies.length; i++)
  {
    if(hobbies[i].checked == true){
      flag = true;
      count++;
    }
  }
  if(flag == false){
    alert("Pleaase select any Hobbies.");
    return false;
  }
  if(count < minCheck){
    alert("Please select atleast "+minCheck+" Hobbies.");
    return false;
  }

}

function validateForm12345(obj){
  var gender = document.getElementsByName('gender');

  var flag = false;
  for (i = 0; i < gender.length; i++)
  {
    if(gender[i].checked == true){
      flag = true;
    }
  }
  if(flag == false){
    alert("Pleaase select any Gender");
    return false;
  }
}

function validateForm1(obj)
{

  var uname = obj.uname;

  if(uname.value==""){
    alert("Name should not be blank.");
    uname.focus();
    return false;
  }

  if(uname.value.length < 10){
    alert("Name should be 10 char long.");
    uname.focus();
    uname.select();
    return false;
  }



}
